package com.tripupdater.event
{
	import com.turner.caf.control.CAFEventDispatcher;

	/**
	 * Singleton
	 */
	public class TUEventDispatcher extends CAFEventDispatcher
	{
		private static var _allowInstantiation:Boolean= false;
		private static var _instance:TUEventDispatcher= null;
		
		public function TUEventDispatcher()
		{
			super();
			
			if(!_allowInstantiation){
				throw new Error("## Trip Updater - Singleton error. Use getInstance() static method");
			}
		}

		public static function getInstance():TUEventDispatcher
		{
			if(_instance == null){
				_allowInstantiation= true;
				_instance= new TUEventDispatcher();
				_allowInstantiation= false;
			}
			
			return _instance;
		}		
	}
}